newRawNonce

fun newRawNonce(bytes: Int = NONCE_BYTES): String(source)

A fresh, cryptographically random nonce/state value as lowercase hex.

SecRandomCopyBytes, not NSUUID and not Random: the nonce is anti-replay, and a predictable one is the same as no nonce at all. A non-zero OSStatus means the system CSPRNG refused, which is not a condition to paper over with a weaker fallback — it throws.